/*------------------------------------------------------
                hou_elearningGEN beta v1.0
Author: xtrung.net@gmail.com
Write On: 04/27/2008
Create On:4/13/2012 11:22:47 AM
------------------------------------------------------*/
using System;
using System.Collections.Generic;
using System.Text;
using System.Reflection;
namespace hou_elearning.Entity
{
    public class ThongbaoEntity
    {
        public ThongbaoEntity()
        {
			m_pk_ithongbaoid=0;
            m_fk_inguoidangthongbaoid = 0;
            m_dngaydang = DateTime.Now;
            m_stieude = "";
            m_snoidung = "";
            m_itrangthai = 1;
        }
		private Int64 m_pk_ithongbaoid;
		public Int64 PK_iThongbaoID
		{
			get { return m_pk_ithongbaoid ; }
			set { m_pk_ithongbaoid = value; }
		}
		private String m_stieude;
		public String sTieude
		{
            get { return m_stieude; }
            set { m_stieude = value; }
		}
        private String m_snoidung;
        public String sNoidung
        {
            get { return m_snoidung; }
            set { m_snoidung = value; }
        }
		private Int16 m_itrangthai;
		public Int16 iTrangthai
		{
			get { return m_itrangthai ; }
			set { m_itrangthai = value; }
		}
		private DateTime m_dngaydang;
		public DateTime dNgaydang
		{
            get { return m_dngaydang; }
            set { m_dngaydang = value; }
		}
		private Int64 m_fk_inguoidangthongbaoid;
		public Int64 FK_iNguoidangthongbaoID
		{
            get { return m_fk_inguoidangthongbaoid; }
            set { m_fk_inguoidangthongbaoid = value; }
		}
        #region Comparison
        public static List<ThongbaoEntity> Sort(List<ThongbaoEntity> list, String SortExpression, String SortDirection)
        {
            string strComparisonAttrb = "COMPARISON_" + SortExpression;
            PropertyInfo propInfo = typeof(ThongbaoEntity).GetProperty(strComparisonAttrb);
            if (propInfo != null)
            {
                list.Sort(propInfo.GetGetMethod().Invoke(null, null) as Comparison<ThongbaoEntity>);
                if (SortDirection == "DESC")
                    list.Reverse();
            }
            return list;
        }
        #endregion
    }
}
